import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-admin-template/v1/api/users/routes',
    method: 'get'
  })
}

export function getAdmins(query) {
  return request({
    url: '/vue-admin-template/v1/api/users/list',
    method: 'post',
    data: query
  })
}

export function createAdmin(data) {
  return request({
    url: '/vue-admin-template/v1/api/users',
    method: 'post',
    data
  })
}

export function updateAdmin(data) {
  return request({
    url: `/vue-admin-template/v1/api/users`,
    method: 'put',
    data
  })
}

export function deleteAdmin(id) {
  return request({
    url: `/vue-admin-template/v1/api/users/${id}`,
    method: 'delete'
  })
}

export function modifyStatus(id, status) {
  return request({
    url: `/vue-admin-template/v1/api/users/status/${id}/${status}`,
    method: 'put'
  })
}
